In this task, I will be working with spatial data regarding the 2008 California DFW oil spill. The analysis will include an interactive tmap of the oil spill sites, and a static choropleth map for which color of each county depends on the count of inland oil spill events.
ca_oil_spill_sf <- read_sf(here('data/oil_spill/ds394.shp')) %>%
clean_names()
ca_counties_sf <- read_sf(here('data/ca_counties/CA_Counties_TIGER2016.shp'))
ca_subset_sf <- ca_counties_sf %>%
clean_names() %>%
select(county_name = name, land_area = aland)
ca_oil_spill_sf <-
st_transform(ca_oil_spill_sf,
st_crs(ca_subset_sf))
tmap_mode(mode = 'view')
#tm_shape(ca_subset_sf) +
# tm_fill('county_name', legend.show = FALSE) +
# tm_shape(ca_subset_sf) +
tm_shape(ca_subset_sf) +
tm_borders() +
tm_basemap(c(StreetMap = "OpenStreetMap",
TopoMap =
"OpenTopoMap")) +
tm_shape(ca_oil_spill_sf) +
tm_dots(col = "green3")